(function () {
    window.addEventListener("DOMContentLoaded", () => {
        let num = 0
        const add = document.getElementById("add")
        const sub = document.getElementById("sub")
        const count = document.getElementById("count")

        add.addEventListener("click", () => {
            num++;
            count.innerHTML = `${num}`
        })
        sub.addEventListener("click", () => {
            num--;
            count.innerHTML = `${num}`
        })
        count.innerHTML = `${num}`
    })
})()